﻿using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;
using Chizx.Model.View;
namespace Chizx.BLL.View
{
    /// <summary>
    /// zx_view_internship
    /// </summary>
    public partial class zx_view_internship
    {
        private readonly Chizx.DAL.View.zx_view_internship dal = new Chizx.DAL.View.zx_view_internship();
        public zx_view_internship()
        { }
        #region  BasicMethod
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string zu_id, string zu_email, string zu_lastdate, string zu_lastip, DateTime zu_createdate, string zu_status, string zc_name, DateTime zc_createdate, int zm_id, int zd_id, string zm_name, int zc_id, DateTime zm_createdate, string zd_name, DateTime zd_createdate, int zsm_id, string zsm_type, int zsm_cid, string zsm_cname, string zsm_caddress, string zsm_applydesc, int zsm_journalnum, string zu_name, string zsm_context, string zsm_attachpath, string zsm_check, DateTime zsm_createdate, string zsm_status, string zu_pwd, int zu_sex, string zu_roles, string zu_weixin, string zu_qq, string zu_tel)
        {
            return dal.Exists(zu_id, zu_email, zu_lastdate, zu_lastip, zu_createdate, zu_status, zc_name, zc_createdate, zm_id, zd_id, zm_name, zc_id, zm_createdate, zd_name, zd_createdate, zsm_id, zsm_type, zsm_cid, zsm_cname, zsm_caddress, zsm_applydesc, zsm_journalnum, zu_name, zsm_context, zsm_attachpath, zsm_check, zsm_createdate, zsm_status, zu_pwd, zu_sex, zu_roles, zu_weixin, zu_qq, zu_tel);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Chizx.Model.View.zx_view_internship GetModel(string zu_id, string zu_email, string zu_lastdate, string zu_lastip, DateTime zu_createdate, string zu_status, string zc_name, DateTime zc_createdate, int zm_id, int zd_id, string zm_name, int zc_id, DateTime zm_createdate, string zd_name, DateTime zd_createdate, int zsm_id, string zsm_type, int zsm_cid, string zsm_cname, string zsm_caddress, string zsm_applydesc, int zsm_journalnum, string zu_name, string zsm_context, string zsm_attachpath, string zsm_check, DateTime zsm_createdate, string zsm_status, string zu_pwd, int zu_sex, string zu_roles, string zu_weixin, string zu_qq, string zu_tel)
        {

            return dal.GetModel(zu_id, zu_email, zu_lastdate, zu_lastip, zu_createdate, zu_status, zc_name, zc_createdate, zm_id, zd_id, zm_name, zc_id, zm_createdate, zd_name, zd_createdate, zsm_id, zsm_type, zsm_cid, zsm_cname, zsm_caddress, zsm_applydesc, zsm_journalnum, zu_name, zsm_context, zsm_attachpath, zsm_check, zsm_createdate, zsm_status, zu_pwd, zu_sex, zu_roles, zu_weixin, zu_qq, zu_tel);
        }

        /// <summary>
        /// 得到一个对象实体，从缓存中
        /// </summary>
        public Chizx.Model.View.zx_view_internship GetModelByCache(string zu_id, string zu_email, string zu_lastdate, string zu_lastip, DateTime zu_createdate, string zu_status, string zc_name, DateTime zc_createdate, int zm_id, int zd_id, string zm_name, int zc_id, DateTime zm_createdate, string zd_name, DateTime zd_createdate, int zsm_id, string zsm_type, int zsm_cid, string zsm_cname, string zsm_caddress, string zsm_applydesc, int zsm_journalnum, string zu_name, string zsm_context, string zsm_attachpath, string zsm_check, DateTime zsm_createdate, string zsm_status, string zu_pwd, int zu_sex, string zu_roles, string zu_weixin, string zu_qq, string zu_tel)
        {

            string CacheKey = "zx_view_internshipModel-" + zu_id + zu_email + zu_lastdate + zu_lastip + zu_createdate + zu_status + zc_name + zc_createdate + zm_id + zd_id + zm_name + zc_id + zm_createdate + zd_name + zd_createdate + zsm_id + zsm_type + zsm_cid + zsm_cname + zsm_caddress + zsm_applydesc + zsm_journalnum + zu_name + zsm_context + zsm_attachpath + zsm_check + zsm_createdate + zsm_status + zu_pwd + zu_sex + zu_roles + zu_weixin + zu_qq + zu_tel;
            object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
            if (objModel == null)
            {
                try
                {
                    objModel = dal.GetModel(zu_id, zu_email, zu_lastdate, zu_lastip, zu_createdate, zu_status, zc_name, zc_createdate, zm_id, zd_id, zm_name, zc_id, zm_createdate, zd_name, zd_createdate, zsm_id, zsm_type, zsm_cid, zsm_cname, zsm_caddress, zsm_applydesc, zsm_journalnum, zu_name, zsm_context, zsm_attachpath, zsm_check, zsm_createdate, zsm_status, zu_pwd, zu_sex, zu_roles, zu_weixin, zu_qq, zu_tel);
                    if (objModel != null)
                    {
                        int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
                        Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
                    }
                }
                catch { }
            }
            return (Chizx.Model.View.zx_view_internship)objModel;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Chizx.Model.View.zx_view_internship> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Chizx.Model.View.zx_view_internship> DataTableToList(DataTable dt)
        {
            List<Chizx.Model.View.zx_view_internship> modelList = new List<Chizx.Model.View.zx_view_internship>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Chizx.Model.View.zx_view_internship model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

